<?php

include_once(dirname(__FILE__)."/../../src/ZipContainer.php");
include_once(dirname(__FILE__)."/../../src/config.inc.php");


class Test045 extends UnitTestCase
{
  function testZipFolder()
  {
    $container = new ZipContainer();
    $container->create(dirname(__FILE__)."/testfiles" ,"testfolder");
    $filename = $container->getSystemFilename();
    
        
    
    $zip = new ZipArchive();
    echo $filename;
    if ($zip->open($filename) === TRUE)
    {
      $this->assertEqual($zip->numFiles, 8);
      
      $this->assertTrue($zip->statName("beamer_tug.pdf") !== false, "beamer_tug.pdf not found");
      $this->assertTrue($zip->statName("beamer_tug.tex") !== false, "beamer_tug.tex not found");
      $this->assertTrue($zip->statName("email.pdf") !== false, "email.pdf not found");
      $this->assertTrue($zip->statName("kontakt.svg") !== false, "kontakt.svg not found");
      $this->assertTrue($zip->statName("phone.pdf") !== false, "phone.pdf not found");
      $this->assertTrue($zip->statName("smail.pdf") !== false, "smail.pdf not found");
      $this->assertTrue($zip->statName("tuglogo.pdf") !== false, "tuglogo.pdf not found");
      $this->assertTrue($zip->statName("web.pdf") !== false, "web.pdf not found");
    }
    else
    {
      $this->assertTrue(false, "Cannot open Zipfile");
    }
    $zip->close();
  //  $container->unlink();
   // $this->assertFalse(file_exists($filename),"file not deleted!");
    
  }
}
?>
